<script setup>
</script>

<template>
<div class="home-category">
    <ul class="menu">
        <li v-for="i in 8" :key="i">
            <div class="category">
                <div class="primary-category"><a href="#">水果</a></div>
                <ul class="secondary-category">
                    <li><a href="#">热带水果</a></li>
                    <li><a href="#">柑橘类</a></li>
                    <li><a href="#">浆果类</a></li>
                    <li><a href="#">瓜果类</a></li>
                </ul>
            </div>
            <!-- 弹层layer位置 -->
            <div class="layer">
                
            </div>
        </li>
    </ul>
</div>
</template>

<style scoped lang='scss'>
.home-category {
    width: 250px;
    height: 540px;
    background: #fff;
    position: relative;
    z-index: 99;

    .menu {
        >li {
            height: 67.5px;

            &:hover {
                background: #fbfbfb;
            }

            .category {
                display: flex;
                flex-direction: column;
                justify-content: space-around;
                height: 100%;
                padding: 7px 30px;

                .primary-category>a {
                    font-weight: bold;
                }

                .secondary-category {
                    display: flex;

                    li {
                        margin-left: 5px;

                        >a {
                            display: inline-block;
                            max-width: 50px;
                            font-size: 12px;
                            overflow: hidden;
                            text-overflow: ellipsis;
                            white-space: nowrap;
                        }

                        &:first-child {
                            margin-left: 0;
                        }
                    }

                }
            }
        }

        

        .layer {
            width: 715px;
            height: 540px;
            background: rgba(255, 255, 255, 0.8);
            position: absolute;
            left: 250px;
            top: 0;
            display: none;
            padding: 0 15px;
        }

    //   &:hover .layer {
    //       display: block;
    //   }
    }
}
</style>
